/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.max.oti.system.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author max
 */
@Entity
@Table(name = "jury", catalog = "dbfiis", schema = "public")
@XmlRootElement
public class Jury implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "position")
    private String position;
    @Basic(optional = false)
    @Column(name = "date_assignment")
    @Temporal(TemporalType.DATE)
    private Date dateAssignment;
    @Basic(optional = false)
    @Column(name = "name_teacher")
    private String nameTeacher;
    @JoinColumn(name = "id_type_comission", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private TypeComission idTypeComission;
    @JoinColumn(name = "id_sustentation_practice", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private SustentationPractice idSustentationPractice;

    public Jury() {
    }

    public Jury(Integer id) {
        this.id = id;
    }

    public Jury(Integer id, String position, Date dateAssignment) {
        this.id = id;
        this.position = position;
        this.dateAssignment = dateAssignment;
    }

    public Jury(String nameTeacher,String position, Date dateAssignment, TypeComission idTypeComission, SustentationPractice idSustentationPractice) {
        this.nameTeacher = nameTeacher;
        this.position = position;
        this.dateAssignment = dateAssignment;
        this.idTypeComission = idTypeComission;
        this.idSustentationPractice = idSustentationPractice;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    
    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public Date getDateAssignment() {
        return dateAssignment;
    }

    public String getNameTeacher() {
        return nameTeacher;
    }

    public void setNameTeacher(String nameTeacher) {
        this.nameTeacher = nameTeacher;
    }

    public void setDateAssignment(Date dateAssignment) {
        this.dateAssignment = dateAssignment;
    }

    public TypeComission getIdTypeComission() {
        return idTypeComission;
    }

    public void setIdTypeComission(TypeComission idTypeComission) {
        this.idTypeComission = idTypeComission;
    }

    public SustentationPractice getIdSustentationPractice() {
        return idSustentationPractice;
    }

    public void setIdSustentationPractice(SustentationPractice idSustentationPractice) {
        this.idSustentationPractice = idSustentationPractice;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Jury)) {
            return false;
        }
        Jury other = (Jury) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.max.oti.system.model.Jury[ id=" + id + " ]";
    }
    
}
